<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Spec::Story::Runner::PlainTextStoryRunner</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Spec::Story::Runner::PlainTextStoryRunner</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../../files/vendor/plugins/rspec/lib/spec/story/runner/plain_text_story_runner_rb.html">
                vendor/plugins/rspec/lib/spec/story/runner/plain_text_story_runner.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../../../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000080">[]=</a>&nbsp;&nbsp;
      <a href="#M000081">load</a>&nbsp;&nbsp;
      <a href="#M000079">new</a>&nbsp;&nbsp;
      <a href="#M000082">run</a>&nbsp;&nbsp;
      <a href="#M000083">steps</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000079" class="method-detail">
        <a name="M000079"></a>

        <div class="method-heading">
          <a href="#M000079" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(*args) {|self if block_given?| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
You can initialize a <a
href="PlainTextStoryRunner.html">PlainTextStoryRunner</a> with the path to
the story file or a block, in which you can define the path using <a
href="PlainTextStoryRunner.html#M000081">load</a>.
</p>
<h2>Examples</h2>
<pre>
  PlainTextStoryRunner.new('path/to/file')

  PlainTextStoryRunner.new do |runner|
    runner.load 'path/to/file'
  end
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000079-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000079-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/story/runner/plain_text_story_runner.rb, line 15</span>
15:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
16:           <span class="ruby-ivar">@options</span> = <span class="ruby-constant">Hash</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">last</span> <span class="ruby-value">? </span><span class="ruby-identifier">args</span>.<span class="ruby-identifier">pop</span> <span class="ruby-operator">:</span> {}
17:           <span class="ruby-ivar">@story_file</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
18:           <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
19:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000080" class="method-detail">
        <a name="M000080"></a>

        <div class="method-heading">
          <a href="#M000080" class="method-signature">
          <span class="method-name">[]=</span><span class="method-args">(key, value)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000080-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000080-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/story/runner/plain_text_story_runner.rb, line 21</span>
21:         <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
22:           <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>
23:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000081" class="method-detail">
        <a name="M000081"></a>

        <div class="method-heading">
          <a href="#M000081" class="method-signature">
          <span class="method-name">load</span><span class="method-args">(path)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000081-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000081-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/story/runner/plain_text_story_runner.rb, line 25</span>
25:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load</span>(<span class="ruby-identifier">path</span>)
26:           <span class="ruby-ivar">@story_file</span> = <span class="ruby-identifier">path</span>
27:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000082" class="method-detail">
        <a name="M000082"></a>

        <div class="method-heading">
          <a href="#M000082" class="method-signature">
          <span class="method-name">run</span><span class="method-args">(story_runner=Spec::Story::Runner.story_runner)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000082-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000082-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/story/runner/plain_text_story_runner.rb, line 29</span>
29:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>(<span class="ruby-identifier">story_runner</span>=<span class="ruby-constant">Spec</span><span class="ruby-operator">::</span><span class="ruby-constant">Story</span><span class="ruby-operator">::</span><span class="ruby-constant">Runner</span>.<span class="ruby-identifier">story_runner</span>)
30:           <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;You must set a path to the file with the story. See the RDoc.&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@story_file</span>.<span class="ruby-identifier">nil?</span>
31:           <span class="ruby-identifier">mediator</span> = <span class="ruby-constant">Spec</span><span class="ruby-operator">::</span><span class="ruby-constant">Story</span><span class="ruby-operator">::</span><span class="ruby-constant">Runner</span><span class="ruby-operator">::</span><span class="ruby-constant">StoryMediator</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">steps</span>, <span class="ruby-identifier">story_runner</span>, <span class="ruby-ivar">@options</span>)
32:           <span class="ruby-identifier">parser</span> = <span class="ruby-constant">Spec</span><span class="ruby-operator">::</span><span class="ruby-constant">Story</span><span class="ruby-operator">::</span><span class="ruby-constant">Runner</span><span class="ruby-operator">::</span><span class="ruby-constant">StoryParser</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">mediator</span>)
33: 
34:           <span class="ruby-identifier">story_text</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-ivar">@story_file</span>)          
35:           <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">story_text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;\n&quot;</span>))
36: 
37:           <span class="ruby-identifier">mediator</span>.<span class="ruby-identifier">run_stories</span>
38:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000083" class="method-detail">
        <a name="M000083"></a>

        <div class="method-heading">
          <a href="#M000083" class="method-signature">
          <span class="method-name">steps</span><span class="method-args">() {|@step_group if block_given?| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000083-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000083-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/story/runner/plain_text_story_runner.rb, line 40</span>
40:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">steps</span>
41:           <span class="ruby-ivar">@step_group</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Spec</span><span class="ruby-operator">::</span><span class="ruby-constant">Story</span><span class="ruby-operator">::</span><span class="ruby-constant">StepGroup</span>.<span class="ruby-identifier">new</span>
42:           <span class="ruby-keyword kw">yield</span> <span class="ruby-ivar">@step_group</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
43:           <span class="ruby-ivar">@step_group</span>
44:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>